package com.jzqf.wheelview;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.jzqf.wheel.CircleLayout;

public class CircleLayoutActivity extends AppCompatActivity {

    CircleLayout circleLayout;
    private int[] mItemImgs = new int[]{R.mipmap.icon_boy, R.mipmap.icon_game, R.mipmap.icon_girl,
            R.mipmap.icon_heart, R.mipmap.icon_movie};
    private String[] mItemTexts = new String[] { "安全中心 ", "特色服务", "投资理财",
            "转账汇款", "我的账户"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_circle_layout);
        circleLayout = findViewById(R.id.id_menulayout);
        circleLayout.setMenuItemIconsAndTexts(mItemImgs,mItemTexts);
        circleLayout.setOnMenuItemClickListener(new CircleLayout.OnMenuItemClickListener() {

            @Override
            public void itemClick(View view, int pos) {
                Toast.makeText(getBaseContext(), "click " + pos, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void itemCenterClick(View view) {
                Toast.makeText(getBaseContext(), "itemCenterClick ", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
